<form>
<h2>ข้อมูลกลุ่มผู้ใช้</h2>
<table width="100%">
	<tbody>
		<tr>
			<td colspan="2">
			  	<? if(permission($menu_id, 'canadd')!=''){ ?> 
				<div id="btnBox" align="right"><a href="<?=$urlpage;?>/form" style="text-decoration:none;"><input type="button" class="ui-state-active ui-corner-all btnAdd" value="เพิ่มรายการ"></a></div>
				<? } ?>
			</td>   
		</tr>
	</tbody>
</table>
<div id="paging" class="pagination">
	<?php echo $pagination;?>
</div>
<div id="main-content">
	<table class="tbContainer">
		<tr>
			<td align="left">
				<table border="0" cellpadding="10" cellspacing="0" width="100%">
					<tbody>	
						<tr class="ui-state-error">
								<th class="ui-state-error tdlist"></th>
								<th class="ui-state-error tdlist">Name</th>
								<th class="ui-state-error tdlist">Manage</th>
						</tr>
							<?php 
							  $rowStyle = '';
							  $page = (isset($_GET['page']))? $_GET['page']:1;
							  $i=(isset($_GET['page']))? (($_GET['page'] -1)* 10)+1:1;
							  foreach($result as $row):
							?>  
						<tr  <? if($rowStyle =='')$rowStyle = 'class="odd"';else $rowStyle = "";echo $rowStyle;?> >
							  <td class="tdlist"><?=$i;?></td>
							  <td class="tdlist" style="cursor: pointer;" align="left" onclick="window.location='<?=$urlpage;?>/form/<?=$row['id'];?>'"><?=$row['name'];?></td>		  
							  <td class="tdlist">
							  	<? if(permission($menu_id, 'candelete')!=''){ ?>
							  	<a href="<?=$urlpage;?>/delete/<?php echo $row['id']?>" style="text-decoration:none;" onclick="return confirm('<?php echo NOTICE_CONFIRM_DELETE?>')"><input type="button" class="btn_delete" /></a>
							  	<? } ?>  	
							  </td>
						</tr>		
									<? 
									$i++;
							  		endforeach; 
									?>		
					</tbody>
				</table>
			</td>
		</tr>
	</table>
</div>
<div id="paging" class="pagination">
<?php echo $pagination;?>
</div>
</form>        